---
title: bud.env
description: bud.js includes support for utilizing dotenv values (in your config, templates and the client).
tags:
  - env
---

**bud.js** includes support for utilizing dotenv values in your configuration, html templates and application code.

Environment variable values are sourced from an `.env` file located in the project root.

## Accessing env values from the config file

Values defined in the application `.env` file are available via `bud.env`.

The **bud.env** object is a container instance.

Most commonly you'll probably find yourself using these methods:

```js title=bud.config.js
bud.env.get('APP_NAME')
```

```js title=bud.config.js
bud.env.is('APP_ENV', 'production')
```

## Accessing env values from within a template

Values defined in the application `.env` file are available within HTML templates. See [**bud.html** usage details](/reference/bud.html).

## Accessing env values from within the application

Any .env values with a key starting with `PUBLIC_` will be available within the application globally.

```env title='.env'
PUBLIC_APP_NAME="My App"
```

The `PUBLIC_APP_NAME` envvar will be available as `APP_NAME` in application source files. This replacement is static, and happens during the build.

```js title=bud.config.js
console.log(APP_NAME)
```

## Related

- [bud.html](/reference/bud.html)
